import { provide, inject } from 'vue';

export const useDependencyInjection = () => {
  const setProvide = (keys, value) => {
    keys.map(key => {
      provide(key, value[key]);
    });
  };

  const getInject = keys => {
    let value = {};
    keys.map(key => {
      value[key] = inject(key);
    });
    return value;
  };

  return {
    setProvide,
    getInject,
  };
};
